/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lenovo
 * Date: 2022-05-12
 * Time: 12:13
 */
public class Data {
    private int year;
    public int month;
    public int day;

    //构造方法
    public Data(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }
//提供接口
    public int getYear() {
        return year;
    }

    public void setYear(int year) {
        this.year = year;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    public int getDay() {
        return day;
    }

    public void setDay(int day) {
        this.day = day;
    }

    public void show(){
        System.out.println("年份"+year+"月份"+month+"号"+day);
    }

    public static void main(String[] args) {
        Data data1 = new Data(2001,8,9);
        data1.show();
    }
}

